home *** CD-ROM | disk | FTP | other *** search
/ Interactive Quarterly / The Best of New Machine Publishing 1 - Disc 4: Interactive Quarterly.iso / pc / demos / az / cyberx.dxr / 00195_VARIOS HANDLERS.ls < prev    next >
Encoding:
Text File  |  1996-10-06  |  2.1 KB  |  86 lines

  1. on activaNiveles
  2.   global cal_1, cal_2, cal_3, vida, escudo, cinta, pase
  3.   repeat with xx = 28 to 32
  4.     puppetSprite(xx, 1)
  5.   end repeat
  6.   set Pos to the number of cast "NIV_00.PIC"
  7.   if vida = 0 then
  8.     set the castNum of sprite 28 to Pos
  9.   else
  10.     set the castNum of sprite 28 to Pos + integer((12 * float(vida) / float(max_vida)) + 0.40000000000000002)
  11.   end if
  12.   if escudo = 0 then
  13.     set the castNum of sprite 29 to Pos
  14.   else
  15.     set the castNum of sprite 29 to Pos + integer((12 * float(escudo) / float(max_escudo)) + 0.40000000000000002)
  16.   end if
  17.   if cal_1 = 0 then
  18.     set the castNum of sprite 30 to Pos
  19.   else
  20.     set the castNum of sprite 30 to Pos + integer((12 * float(cal_1) / float(max_cal_1)) + 0.40000000000000002)
  21.   end if
  22.   if cal_2 = 0 then
  23.     set the castNum of sprite 31 to Pos
  24.   else
  25.     set the castNum of sprite 31 to Pos + integer((12 * float(cal_2) / float(max_cal_2)) + 0.40000000000000002)
  26.   end if
  27.   if cal_3 = 0 then
  28.     set the castNum of sprite 32 to Pos
  29.   else
  30.     set the castNum of sprite 32 to Pos + integer((12 * float(cal_3) / float(max_cal_3)) + 0.40000000000000002)
  31.   end if
  32.   if pase = 1 then
  33.     set the visible of sprite 33 to 1
  34.   else
  35.     set the visible of sprite 33 to 0
  36.   end if
  37.   if cinta = 1 then
  38.     set the visible of sprite 34 to 1
  39.   else
  40.     set the visible of sprite 34 to 0
  41.   end if
  42. end
  43.  
  44. on minimos
  45.   global cal_1, cal_2, cal_3, vida, escudo
  46.   if cal_1 < 50 then
  47.     set cal_1 to 50
  48.   end if
  49.   if cal_2 < 20 then
  50.     set cal_2 to 20
  51.   end if
  52.   if cal_3 < 10 then
  53.     set cal_3 to 10
  54.   end if
  55.   if vida < 60 then
  56.     set vida to 60
  57.   end if
  58.   if escudo < 30 then
  59.     set escudo to 30
  60.   end if
  61. end
  62.  
  63. on cambiaNivel
  64.   global ProgInit, Niv, Primero, Punto, cal_1, cal_2, cal_3, vida, escudo
  65.   set CodTecla to the keyCode
  66.   if (CodTecla > 81) and (CodTecla <= 89) then
  67.     set Niv to CodTecla - 82
  68.     go("CambiaNivel", ProgInit)
  69.     exit
  70.   else
  71.     if CodTecla = 78 then
  72.       set cal_1 to 99
  73.       set cal_2 to 99
  74.       set cal_3 to 99
  75.       set vida to 99
  76.       set escudo to 99
  77.       activaNiveles()
  78.     else
  79.       if CodTecla = 66 then
  80.         preLoad(Primero + Punto)
  81.         go(Primero + Punto)
  82.       end if
  83.     end if
  84.   end if
  85. end
  86.